import javax.swing.*;

/**
 * ****************************************************************************
 * $Author: Yegor Chemisov $
 * $Revision: 2.2 $
 * ****************************************************************************
 */

public class Flash extends Thread
{
    MemoryBoard board;
    int showTime;

    public Flash (MemoryBoard board, int showTime)
    {
        this.board  = board;
        this.showTime  = showTime;
    }

    public void run()
    {
        JOptionPane.showMessageDialog(StartGame.mainFrame,
                MAPConsts.RES.getString(GlobalRes.MSG_PREPARE),
                MAPConsts.RES.getString(GlobalRes.PROGRAMM_TITLE),
                JOptionPane.WARNING_MESSAGE);

        try {
            board.showAll();
            Thread.sleep(showTime);
            board.hideAll();
        }
        catch (InterruptedException e)
        {
            e.printStackTrace();
            return;
        }
    }
}
